/*
 * @Author: Qimu
 * @Date: 2020-04-17 08:36:48
 * @LastEditors: Qimu
 * @LastEditTime: 2020-07-09 17:23:25
 * @Description: file content
 * @FilePath: \vue-admin-koa2\koa2_api\module\schama\article.js
 */
const mongoose = require('../db/mongodb');
const config = require('../config/config');

const articleSchema = mongoose.Schema({
  article_title: { //文章名称
    type: String,
    required: true,
    trim: true
  },
  article_summary: { //文章简述
    type: String,
    required: true,
    trim: true
  },
  article_category: { //文章分类
    type: String,
  },
  article_tagValue: { //文章标签
    type: String,
  },
  article_isPublish: { //文章是否发布
    type: String,
    default: 1
  },
  article_content: { //文章内容
    type: String,
    required: true,
  },
  article_createTime: { //文章创建时间
    type: String,
    required: true,
    trim: true,
  },
})

module.exports = article = mongoose.model('article', articleSchema, `${config.mongodb.table}article`);